#ifndef SOUND_H
#define SOUND_H
#include <SDL.h>

class CSound
{
private:
	//! raw PCM sample data
	Uint8* m_sample; 

	//! size of sound data in bytes
	Uint32 m_length; 

public:
	//!Constructor.
	CSound();

	//!Destructor.
	~CSound();

	//!Load a wav sound.
	/*!
	\param filename Name of the wav file to load.
	\param spec Pointer to the audio specification data.
	\return True if the sound was loaded. False if it failed.
	*/
	bool loadAndConvertSound(const char* filename, SDL_AudioSpec* spec);

	//!Load a wav sound from a buffer in memory.
	/*!
	\param buffer Buffer containing the wav sound.
	\param fileSize Size of the buffer.
	\param spec audio specification.
	\return True if the file was loaded. False if it failed.
	*/
	bool loadAndConvertSoundFromMemory(char* buffer, int fileSize, SDL_AudioSpec* spec);
	
	//!Get Sample data.
	/*!
	\return Return the sample.
	*/
	Uint8* getSample(void)const;

	//!Get the length of the sound
	/*!
	\return Return the length of the sound.
	*/
	Uint32 getLength(void)const;
	

};
#endif

